package com.platform.modules.plug.controller;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import com.platform.common.exception.BaseException;
import com.platform.common.shiro.ShiroUtils;
import com.platform.common.version.ApiVersion;
import com.platform.common.version.VersionEnum;
import com.platform.common.web.domain.AjaxResult;
import com.platform.modules.chat.domain.ChatGroup;
import com.platform.modules.chat.domain.ChatUser;
import com.platform.modules.chat.service.ChatUserService;
import com.platform.modules.chat.vo.MyVo09;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/open")
public class ChatUserController {

    @Resource
    private ChatUserService chatUserService;

    /**
     * 获取用户详情
     */
    @ApiVersion(VersionEnum.V1_0_0)
    @GetMapping("/getUserInfo/{userId}")
    public AjaxResult getUserInfo(@PathVariable Long userId) {

        ChatUser chatUser = chatUserService.getById(userId);
        MyVo09 convert = Convert.convert(MyVo09.class, chatUser);

        return AjaxResult.success(convert);
    }
}
